#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <vector>
#include <QMainWindow>
#include <QGraphicsScene>
#include <QModelIndex>
#include <QLabel>
#include <QTimer>
#include <memory>
#include "CA/igrid.h"
#include "CA/epidemicca.h"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);

    ~MainWindow();

private slots:
    void update();
    void repaint();
    void on_listWidget_clicked(const QModelIndex &index);

    void on_nextButton_clicked();

    void on_challengeButton_clicked();

    void on_firstButton_clicked();

private:
    Ui::MainWindow *ui;
    QGraphicsScene scene;
    QGraphicsScene scene2;
    QTimer timer;
    static const unsigned int CELL_SIZE;
    static const unsigned int LINE_THICKNESS;
    static const unsigned int SIZE;
    static const unsigned int EVOLUTION_LIMIT;
    static const QColor WHITE_COLOUR;
    static const QColor BLACK_COLOUR;
    static const QPen CELL_PEN;


    std::vector<std::shared_ptr<IGrid> > evolution;
    shared_ptr<EpidemicCA> ca;
    unsigned step;
};


#endif // MAINWINDOW_H
